<?php
class Settings_Model_DbTable_SettingsFanPage extends YouNet_Db_Table
{
	const TABLE_NAME = 'ym_settings';
	protected $_name = self::TABLE_NAME;
	protected $_rowClass = 'Settings_Model_SettingFanPage';
	private static $_instance;
    
    const STATUS_REQUIRE_FANGATE = 1;
    const STATUS_NOT_REQUIRE_FANGATE = 0;
    
    const STATUS_ALLOW_COMMENT = 1;
    const STATUS_NOT_ALLOW_COMMENT = 1;

	/**
	 * @return Payment_Model_DbTable_Items
	 */
	public static function getInstance()
	{
		if (is_null(self::$_instance))
		{
			self::$_instance = new self();
		}
		return self::$_instance;
	}
	
	public function getSettingInfo($id_campaign)
    {
        $select = $this->select()
    			->setIntegrityCheck(false)
    			->from(array('e' => self::TABLE_NAME))
    			->where('id_campaign = ?',$id_campaign);
       
		return $this->fetchAll($select)->current();
    }
    public function getRowSetting($id_campaign)
    {
        $ret_row = $this->findOne($id_campaign);
        if( empty($ret_row) )
        {
            $ret_row = $this->createRow();
        }
		return $ret_row ;
    }
  
}

